package it.orma.iridehr.validators;

import it.orma.iridehr.controllers.form.candidato.NoteForm;

import org.springframework.binding.validation.ValidationContext;
import org.springframework.stereotype.Component;


@Component
public class NoteFormValidator {

public void validate(NoteForm noteForm, ValidationContext context) {
		
	if (noteForm.getNote().getSchedaCandidato()==null)
		noteForm.getNote().setUserCreazione(context.getUserPrincipal().getName());
	else
		noteForm.getNote().setUserModifica(context.getUserPrincipal().getName());
				
	}
}
